<?php
/* @var $this PurchaseOrderHeaderController */
/* @var $model PurchaseOrderHeader */

$this->breadcrumbs=array(
	'Purchase Order Headers'=>array('index'),
	'Create',
);
Yii::app()->clientScript->registerScript('search', "
$('#attention').blur(function(){
	document.getElementById('employee_id').value='".Yii::app()->session['id']."';
	return true;
});
$('#getProduct').click(function(){
	document.getElementById('employee_id').value='".Yii::app()->session['id']."';
	return true;
});

");

$this->menu=array(
	array('label'=>'View Quotation', 'url'=>array('purchaseorderheader/viewQuotation','id'=>$quo_no)),
);
?>

<h1>Create PurchaseOrderHeader</h1>

<?php $this->renderPartial('_form', array('model'=>$model,'quo_no'=>$quo_no)); ?>

<?php
	$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
        'id'=>'mydialog2',
        'options'=>array(
            'title'=>'Select Item',
            'autoOpen'=>false,
            'modal'=>true,
            'buttons'=>array(
                'Submit'=>'js:addItem',
                'Cancel'=>'js:function(){ $(this).dialog("close");}',
            ),
        ),
    ));

    echo '<div class="dialog_input"><input type="text" id="item-name-input" name="item-name"/></div>';

 
    $this->endWidget('zii.widgets.jui.CJuiDialog');
?>
<script type="text/javascript" >
    function addItem(){
        $(this).dialog("close");
        alert( $("#item-name-input").val() + " has been added");
    }
</script>
